#ifndef STX_ALGORITHM_FIND_HPP
#define STX_ALGORITHM_FIND_HPP

#include <stx/algorithm/common.hpp>

namespace stx {

template<class InputIterator, class T>
inline InputIterator
find(InputIterator first, InputIterator last, const T& value)
{
    for (; first != last; ++first) {
        if (*first == value) {
            break;
        }
    }
    return first;
}

template<class Container, class T>
inline typename Container::iterator
find(Container& c, const T& value)
{
    return stx::find(stx::begin(c), stx::end(c), value);
}

template<class Container, class T>
inline typename Container::const_iterator
find(const Container& c, const T& value)
{
    return stx::find(stx::begin(c), stx::end(c), value);
}

template<class InputIterator, class T>
inline InputIterator
find(stx::iterator_range<InputIterator> r, const T& value)
{
    return stx::find(stx::begin(r), stx::end(r), value);
}

} // namespace stx

#endif // STX_ALGORITHM_FIND_HPP
